<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	template="/pages/templates/template.xhtml">
	<ui:define name="metadata">
		<f:metadata>
			<f:viewParam name="matricula" value="#{AlunoNovoBean.matricula}" />
			<f:event type="preRenderView" listener="#{AlunoNovoBean.init}" />
		</f:metadata>
	</ui:define>
	<ui:define name="content">
		<h:form id="formAluno">
			<div>
				<div class="div-titulo-tela">
					<p:outputLabel styleClass="titulo-tela">Aluno</p:outputLabel>
					<br /> <br />
					<p:separator></p:separator>
					<div class="div-titulo-botoes">
						<p:commandButton value="Lista" rendered="#{AlunoNovoBean.logado}"
							actionListener="#{AlunoNovoBean.doListar}" />

						<p:commandButton id="btnSalvar" value="Salvar" ajax="true"
							update="formAluno" actionListener="#{AlunoNovoBean.salvar}">
						</p:commandButton>
					</div>
				</div>
				<div>
					<div class="div-corpo-tela">
						<div class="div-mensagem">
							<p:messages id="messages" autoUpdate="true" closable="true" />
						</div>

						<p:fieldset legend="Dados Pessoais" styleClass="fldPerfil">
							<p:outputPanel styleClass="boxDadosPessoais">
								<p:outputLabel styleClass="label">Matrícula:</p:outputLabel>
								<p:inputText id="txtMatriculaaluno" styleClass="campo"
									required="true" value="#{AlunoNovoBean.aluno.matricula}"></p:inputText>
								<br />

								<p:outputLabel styleClass="label">Nome:</p:outputLabel>
								<p:inputText id="txtNomealuno" styleClass="campo"
									required="true" value="#{AlunoNovoBean.aluno.nome}"></p:inputText>
								<br />

								<p:outputLabel styleClass="label">Documento:</p:outputLabel>
								<p:inputText id="txtDocumentoaluno" styleClass="campo"
									required="true" value="#{AlunoNovoBean.aluno.documento}"></p:inputText>
								<br />

								<p:outputLabel styleClass="label">Curso: </p:outputLabel>
								<h:selectOneMenu styleClass="campo" id="curso" label="Curso"
									value="#{AlunoNovoBean.cursoID}" required="true">
									<f:selectItem itemLabel="Selecione..." itemValue="" />
									<f:selectItems value="#{AlunoNovoBean.cursos}"
										itemValue="#{c.id}" itemLabel="#{c.nome}" var="c" />
								</h:selectOneMenu>
								<br />

								<p:outputLabel styleClass="label"
									rendered="#{!AlunoNovoBean.logado}">Senha:</p:outputLabel>
								<p:password id="senha" label="Senha" styleClass="campo"
									rendered="#{!AlunoNovoBean.logado}"
									value="#{AlunoNovoBean.aluno.senha}" required="true" />
								<br  />

								<p:outputLabel styleClass="label"
									rendered="#{!AlunoNovoBean.logado}">Repete Senha:</p:outputLabel>
								<p:password id="repeteSenha" label="Repete Senha"
									rendered="#{!AlunoNovoBean.logado}" styleClass="campo"
									value="#{AlunoNovoBean.aluno.repeteSenha}" required="true" />


								<p:outputLabel styleClass="label"
									rendered="#{AlunoNovoBean.logado}">Formando:</p:outputLabel>
								<p:selectBooleanButton id="btnFormando" onLabel="Sim"
									 rendered="#{AlunoNovoBean.logado}"
									offLabel="Não" onIcon="ui-icon-check" offIcon="ui-icon-close"
									value="#{AlunoNovoBean.aluno.formando}">
								</p:selectBooleanButton>
								<br />

								<p:outputLabel styleClass="label"
									rendered="#{AlunoNovoBean.logado}">Coeficiente de Rendimento:</p:outputLabel>
								<p:inputMask styleClass="campo"
									rendered="#{AlunoNovoBean.logado}"
									value="#{AlunoNovoBean.aluno.coeficienteRendimento}"/>

							</p:outputPanel>
						</p:fieldset>
						<p:fieldset legend="Contatos" styleClass="fldPerfil">
							<p:outputPanel styleClass="boxContatos">
								<p:outputLabel styleClass="label">E-mail:</p:outputLabel>

								<p:inputText id="txtEmailaluno" styleClass="campo"
									required="true" value="#{AlunoNovoBean.aluno.email}"></p:inputText>

								<br />
								<p:outputLabel styleClass="label">Telefones:</p:outputLabel>
								<br />
								<p:outputPanel styleClass="boxTelefones">

									<p:inputMask id="txtFoneResidencial" styleClass="campo"
										mask="(99) 9999-9999"
										value="#{AlunoNovoBean.foneResidencial.numero}"></p:inputMask>
									<p:outputLabel styleClass="label">Residencial</p:outputLabel>
									<p:inputMask id="txtFoneCelular" styleClass="campo"
										mask="(99) 9999-9999"
										value="#{AlunoNovoBean.foneCelular.numero}"></p:inputMask>
									<p:outputLabel styleClass="label">Celular</p:outputLabel>
									<p:inputMask id="txtFoneComercial" styleClass="campo"
										mask="(99) 9999-9999"
										value="#{AlunoNovoBean.foneComercial.numero}"></p:inputMask>
									<p:outputLabel styleClass="label">Comercial</p:outputLabel>
								</p:outputPanel>
							</p:outputPanel>
						</p:fieldset>
					</div>
				</div>
			</div>
		</h:form>
	</ui:define>
</ui:composition>

